package main;

import ro.ubbcluj.cs.bs.backend.model.Author;
import ro.ubbcluj.cs.bs.backend.service.AuthorService;

import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Created by Levente on 2014.05.18..
 */
public class MainClass {
    public static void main(String[] args) {
        try {
            System.out.println("Main class started!");
            final InitialContext ic = new InitialContext();
            System.out.println("Main class started!");
            final AuthorService authorService = (AuthorService) ic.lookup("java:global/bsee-server/bsee-backend-1.0.0-SNAPSHOT/AuthorService");
            System.out.println("Main class started!");
            final Author author = new Author("Simon", "Karoly");
            authorService.insertAuthor(author);
            System.out.println(author);
        } catch (final NamingException e) {
            e.printStackTrace();
        }
    }
}
